package com.employee.seckill.advice;

import com.employee.seckill.util.Result;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * ClassName: GlobalExceptionHandler
 * Package: com.employee.seckill.advice
 * Description:
 *
 * @Author 刘荟雅
 * @Create 2025/9/11 15:41
 * @Version 1.0
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    // 捕获所有异常
    @ExceptionHandler(Exception.class)
    public Result<Void> handle(Exception e) {
        return Result.error(e.getMessage());
    }
}
